<?php
/**
 * 奖品管理的活动记录信息
 * 可用于商品使用记录统计
 */

namespace App\Models\ActivityInfo;

use App\Support\Database\Eloquent\UuidModel;

class ActivityInfo extends UuidModel
{
    const IS_EXCHANGE_NO = 0;
    const IS_EXCHANGE_YES = 1;

    public function activityRecord()
    {
        return $this->hasMany('\App\Models\ActivityRecord\ActivityRecord', 'activity_id');
    }

    public function prize()
    {
        return $this->belongsToMany('\App\Models\Prize\Prize', 'activity_prizes', 'activity_id', 'prize_id');
    }

    public function prizeRecord()
    {
        return $this->hasMany('\App\Models\PrizeRecord\PrizeRecord', 'activity_id', 'id');
    }
}
